package com.jhte.scheduleJob.base.util;

/**
 * @author wuchun
 * @description 响应实体类
 * @create 2018/1/31 18:31
 */
public class BaseResponse {

    private int code;
    private String msg;
    private Object data;

    public void fail() {
        code = BaseMsg.CODE_FAILED;
        msg = BaseMsg.MSG_FAILED;
    }

    public void success() {
        code = BaseMsg.CODE_SUCCESS;
        msg = BaseMsg.MSG_SUCCESS;
    }

    public void success(Object object) {
        code = BaseMsg.CODE_SUCCESS;
        msg = BaseMsg.MSG_SUCCESS;
        data = object;
    }

    public void exception() {
        code = BaseMsg.CODE_EXCEPTION;
        msg = BaseMsg.MSG_EXCEPTION;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
